<template>
  <div class="tab">
    <van-icon name="arrow-left" />
    <h3>宝哥的移动端</h3>
    <van-icon name="wap-nav"  @click = "changeMask"/>
    <div class="mask" v-if = "maskFlag">
      <ul>
        <li v-for="item in navs" :key="item.id">
          <a href="">{{ item.text }}</a>
        </li>
      </ul>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      maskFlag: false,
      navs: [
        {
          id: 1,
          text: "首页",
        },
        {
          id: 2,
          text: "榜单",
        },
        {
          id: 3,
          text: "热点",
        },
        {
          id: 4,
          text: "商城",
        },
      ],
    };
  },
  methods:{ 
    changeMask() {
        this.maskFlag = !this.maskFlag
    }
  }
};
</script>

<style lang="scss" scoped>
@import "@/assets/style/color.scss";
.tab {
  width: 375px;
  height: 51.5px;
  background: $theme_color;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: white;
  h3 {
    font-size: 18px;
    font-weight: normal;
  }
  .van-icon-arrow-left {
    width: 24px;
    height: 24px;
    padding-left: 12px;
  }
  .van-icon-wap-nav {
    margin: 0 12px 0 0;
  }
}
.mask {
  position: fixed;
  top: 46px;
  right: 12px;
  width: 110px;
  height: 185px;
  background: white;
  z-index: 99;
  box-shadow: 0 3px 9px 0 rgab(0 0 0 0.1);
  ul {
    height: 100%;
    display: flex;
    justify-content: space-evenly;
    flex-direction: column;
    li {
      height: 25%;
      font-size: 15px;
      line-height: 45.5px;
      text-align: center;
      border-bottom: 1px solid #f0f0f0;
      a {
        color: #333;
      }
    }
  }
}
</style>